home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cutils.arc / TIME.ASM < prev   
Assembly Source File  |  1985-08-30  |  2KB  |  59 lines

  1.                         TITLE   Time Routines for Lattice
  2.                         NAME    TIME
  3.                         INCLUDE DOS.MAC
  4.  
  5. COMMENT $
  6.                 AUTHOR          Jon Wesener
  7.                 DATE            7 / 22 /85
  8.                 PURPOSE           These routines will provide access to
  9.                                 the onboard clock routines.
  10.         $
  11.  
  12.                 PSEG
  13.                 PUBLIC  GETTIME, SETTIME
  14.  
  15. ; Gettime returns the current time as stated by the PC
  16. ;  time(&hour, &min, &sec, &hun);
  17. ; RETURN:       nothing
  18.  
  19. GETTIME         PROC    NEAR
  20.                 push    bp
  21.                 mov     bp, sp
  22.                 mov     ax, 2c00h       ; get the time
  23.                 int     21h
  24.                 xor     ax, ax
  25.                 mov     di, [bp+4]      ; point to hours
  26.                 mov     al, ch
  27.                 stosw                   ; send hours home
  28.                 mov     di, [bp+6]      ; pt to minutes
  29.                 mov     al, cl
  30.                 stosw                   ; send back minutes
  31.                 mov     di, [bp+8]
  32.                 mov     al, dh
  33.                 stosw                   ; same for seconds
  34.                 mov     di, [bp+10]
  35.                 mov     al, dl
  36.                 stosw                   ; and for hundredths
  37.                 pop     bp
  38.                 ret
  39. GETTIME         ENDP
  40.  
  41. ; Settime allows you to set the time
  42. ;  err= settime(hour, min, sec, hun);
  43. ; RETURN:       0= Success      ?= Error
  44.  
  45. SETTIME         PROC    NEAR
  46.                 push    bp
  47.                 mov     bp, sp
  48.                 mov     ax, 2d00h
  49.                 mov     cx, [bp+6]      ; get minutes
  50.                 mov     ch, [bp+4]      ; get hours
  51.                 mov     dx, [bp+10]     ; get hundredths
  52.                 mov     dh, [bp+8]      ; get seconds
  53.                 int     21h
  54.                 pop     bp
  55.                 ret
  56. SETTIME         ENDP
  57.                 ENDPS
  58.                 END
  59.